The image enhancement technology is a kind of image process technology. It can significantly improve the image quality to make the image content with more senses of hierarchy, and the subjective watch result meets the demands of the people in advance. In real life, kinds of defects exist in the original image. For example, the aperture is small as shooting to result that the image is dark; the contrast of the scene is lower, and thus the point of the image is not unobtrusive; overexposure causes the image disorder and the white photo. With the image enhancement technology, the aforesaid issues can be effectively solved to promote the display quality.
The common image enhancement technology includes: saturation enhancement and contrast enhancement. Compared with the saturation enhancement, the contrast enhancement draws more attentions. The contrast enhancement is to adjust the gray scale distribution of the image, and to increase the distribution range of the image gray scale to raise the contrast of the whole or the portion of the image for improving the visual effect. The contrast enhancement can be categorized: Histogram Equalization and Gamma Correction. The Gamma Correction method uses the Gamma function to be the mapping function to raise the image contrast. As the method is applied for the enhancement of the contrast, it is very difficult to set a Gamma value suitable for every image, and when the wrong Gamma value is set, the original colors may change. The Histogram Equalization method is to compress the gray scale which the pixel number is less and expand the gray scale which the pixel number is more to obtain the image with higher contrast after process.
The Histogram Equalization method can comprise: Global Histogram Equalization (GHE) and Local Histogram Equalization (LHE). The Global Histogram Equalization is mainly to amend the histogram distribution of the image to achieve the objective of the contrast enhancement; and the Local Histogram Equalization is to predefine a local contrast, and then to enhance the local contrast to realize the effect of enhancing the image details.
FIG. 1 and FIG. 2 respectively show the histogram and display effect diagram of the original image. It can be observed that the contrast of the original image is very low, and display effect is bad.
Enhancing the contrast of the image with the Global Histogram Equalization method according to prior art generally comprises the following steps:
step 1, converting an image into a gray scale image, and the conversion formula is:Gray(i,j)=((R(i,j)+G(i,j)+B(i,j))/3
wherein Gray(i,j) is a gray scale value of one pixel, and R(i,j), G(i,j) and B(i,j) respectively are gray scale values corresponding to the red sub pixel, the green sub pixel and the blue sub pixel of the pixel.
step 2, as shown in FIG. 3, counting the pixel amount corresponded with each gray scale value according to the gray scale value from 0 to 255, and making the histogram correspondingly;
step 3, as shown in FIG. 4, performing histogram cumulative calculation to the pixel amount corresponded with each gray scale value from 0 to 255, and the formula is:C(X)=Σj=0225H(j)wherein, H(j) represents the pixel amount corresponding to the gray scale value j;
step 4, as shown in FIG. 5, performing normalization to the maximum of the cumulative histogram, and the formula is:N(X)=Σj=0255H(j)/C(255)
and then, multiplying the data after the normalization process by 255, to obtain:out(x)=N(x)×255;
step 5, obtaining the corresponding new gray scale value by looking up table according to out(x).
FIG. 6 and FIG. 7 respectively are a histogram diagram and a display effect diagram of the image, in which the contrast is enhanced with the Global Histogram Equalization method according to prior art. It can be seen that the contrast of the image after the contrast enhancement gains a certain degree promotion. The display effect is improved but the contrast remains to be lower, and the display image has distortion.